home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
batchut
/
unicda15.zip
/
UNI-CDA.DOC
< prev
Wrap
Text File
|
1993-10-23
|
8KB
|
179 lines
UNI-CDA 1.50
(UniNova's Check Disk Availability)
(c) 1993 by UniNova Services Corporation
TABLE OF CONTENTS
-----------------
What is CDA? ................................................... 1
Disclaimer ..................................................... 1
How To... ...................................................... 1
Run the CDA program ........................................ 1
Use CDA in a batch file .................................... 2
Sample batch #1 ........................................ 2
Sample batch #2 ........................................ 2
Copyright ...................................................... 3
Contacting UniNova ............................................. 3
Closing Notes .................................................. 3
WHAT IS CDA?
------------
CDA is a simple program to check if a disk is ready to be read. It is handy
in batch files (e.g., BBS maintenance batch files) to check that a drive is
ready before using it (it's annoying to have a BBS batch file hang up, waiting
or the Sysop to press (A)bort, (R)etry, etc.). CDA will return a DOS error-
level of 1 if the drive is NOT ready, and 0 if it -is- ready. CDA may be
distributed and used freely; source code may be purchased for $15. See the
section CONTACTING UNINOVA for more information about obtaining the source
code. See the section COPYRIGHT for additional information about your rights
regarding CDA.
DISCLAIMER
----------
By using CDA on your computer, you agree to assume full responsibility for
the effects (or lack of effect) of the program on your system. You agree to
hold UniNova Services Corporation blameless and without liability, even in
the event that some type of damage occurs. CDA IS PROVIDED AS IS, WITH NO
WARRANTY OR GUARANTEE, EXPRESS OR IMPLIED, OF ANY KIND. This implicit agree-
ment between you, the user, and UniNova Services Corporation is governed by
the laws of the State of Delaware.
HOW TO...
---------
RUN THE CDA PROGRAM:
--------------------
Simply make a call to the program from the DOS prompt or batch file,
giving it one parameter indicating the drive letter to check. CDA will
use the first letter of the first parameter, so all four of these
commands:
CDA A:
CDA A DRIVE
cda a:\
CDA APPLES AND ORANGES
will check drive A to see if it is ready for use. Then, you just need
to test the DOS errorlevel. (See your DOS manual if you need specific
information about DOS errorlevels.) CDA is not case sensitive. The
program will give a terse visual message indicating its results.
USE CDA IN A BATCH FILE
-----------------------
As always, it is important to check errorlevels from the highest to
lowest, as DOS will return TRUE for a command IF ERRORLEVEL n in any
condition where the errorlevel is n or higher. The original purpose
for CDA was to check a CD-ROM drive to auto-detect the CD in the drive
(for the UniNova Support BBS). However, it is not limited to use with
CD-ROM drives. Here are two example batch files in which you could use
CDA:
@ECHO OFF
REM This is sample batch file 1, to back up files to a floppy.
REM If this is run by a nightly event, you don't want to run the
REM risk of the drive not being ready and holding up your system
REM with an error message. Assuming you're just copying files to
REM the disk in drive A or B, this should work for you:
REM
CDA A
IF ERRORLEVEL 1 GOTO NOT-A
GOTO USE-A
:NOT-A
CDA B:
IF ERRORLEVEL 1 GOTO NEITHER
GOTO USE-B
:USE-A
COPY C:\BIN\*.CPP A:
GOTO END
:USE-B
COPY C:\BIN\*.CPP B:
GOTO END
:NEITHER
ECHO Neither drive A nor drive B is ready for use! >> error.log
:END
@ECHO OFF
REM This is sample batch file 2, which is a close copy from the
REM original use for CDA at UniNova. It checks to make sure the
REM CD-ROM drive (drive letter J) is ready before looking for
REM specific files that identify the actual disc in the drive.
REM
CDA J
IF ERRORLEVEL 1 GOTO NODISC
IF EXIST J:\DISC.1 GOTO ONE
IF EXIST J:\DISC.2 GOTO TWO
GOTO NEITHER
:ONE
ECHO CD-ROM disc ONE is on-line and ready for use. > hello8.bbs
GOTO END
:TWO
ECHO CD-ROM disc TWO is on-line and ready for use. > hello8.bbs
GOTO END
:NEITHER
ECHO The on-line CD-ROM is not currently available. > hello8.bbs
GOTO END
:NODISC
ECHO No CD-ROM is on-line at this time. > hello8.bbs
ECHO ***** CD-ROM not on-line! >> activity.001
:END
These are just two samples for ways to use CDA in batch files. You will
probably have a use in mind already, which is why you took the time to
get the program, so these samples may not be fully relevant.
COPYRIGHT
---------
Although CDA is free to use, it is not public domain software! All rights
to CDA are reserved by UniNova Services Corporation. You are given the
following specific permissions (license), any or all of which may be revoked
at any time:
1. You may copy, distribute, and use CDA without charge, IF AND ONLY
IF:
a) You include all documentation files you received with the copies
you distribute; and,
b) You do NOT modify the program or documentation in any way,
including (but not limited to) removing the copyright notice; and,
c) You notify the recipient of the copies you distribute that they
do not own the program but merely have free license to use it in
the manner outlined in this section.
2. You may incorporate CDA in your own hardware or software applications
without royalty, IF AND ONLY IF you obtain written permission from UniNova
Services Corporation IN ADVANCE. If you incorporate it in a system
without prior written permission, you are subject to payment of penalty
fees and continuing royalties; compared with getting the permission in
advance, it's not worth it to skip that necessary step.
CONTACTING UNINOVA
------------------
UniNova Services Corporation may be contacted via:
Postal mail: UniNova Services Corporation
PO Box 900
Ellensburg, WA 98926
BBS/FAX: (509) 925-3893 (USA)
CompuServe: c/o Stuart Whitmore: 71221,1737
Internet: c/o Stuart Whitmore: 71221.1737@compuserve.com
If you would like to purchase a hard copy of the source code, send a check
or money order to the above postal mail address for $15 (USD). If you are
in Washington State, add the current state sales tax. Redistribution of
the source code in any form is strictly prohibited; the code is for your
personal use only.
CLOSING NOTES
-------------
UniNova and UniNova Services Corporation are trademarks of UniNova Services
Corporation. Other trademarks, trade names, service marks, etc., that may
appear in this document are the property of their respective owners.
Version History, reverse chronology:
1.50 - Fixed error with reporting that a blank, formatted disk made the
drive not ready. Fixed reporting of invalid drives as ready.
1.00 - Original release.